@page
@{ Layout = "_Layout"; }

@section Styles{
    <link href="/sitefiles/assets/lib/geeks/css/bootstrap-icons.css" rel="stylesheet" />
    <link href="/sitefiles/assets/lib/geeks/css/theme.min.css" rel="stylesheet" type="text/css" />
    <style>
        .el-timeline-item__timestamp.is-top{
            padding-top:2px;      
        }
    </style>
}

<el-card>
    <el-row :gutter="18">
        <el-col :span="8">
            <div class="pt-3"></div>
            <el-timeline>
                <el-timeline-item timestamp="管理员工作日志" placement="bottom" type="warning" size="large" icon="el-icon-info">
                    <h4>动态</h4>
                    <span slot="dot"><i class="el-icon-info h3"></i></span>
                </el-timeline-item>
            </el-timeline>
            <div class="ps-1">
                <el-scrollbar class="scrollbar" :style="{ height: ($(window).height()-145) + 'px' }">
                    <div class="pe-3" v-if="total>0">
                        <el-timeline>
                            <el-timeline-item class="pb-2" :timestamp="log.date" :type="log.color" placement="top" v-for="log in list">
                                <div class="py-2">
                                    <div class="fs-6">
                                        <div class="d-flex align-items-start">
                                            <el-link class="fs-6 me-2" size="mini" v-on:click="utils.openAdminView(log.adminId)"><nobr><i class="el-icon-user-solid me-1"></i>{{ log.adminName }}</nobr></el-link>
                                            <span><span :class="'text-'+log.color" class="fw-bolder">{{ log.title }}</span><span v-if="log.name.length>0">（{{ log.name }}）</span></span>
                                        </div>
                                    </div>
                                    <div class="mt-2" v-if="log.statType==='Export'">
                                        <el-link class="fs-6" size="mini" icon="el-icon-download" v-on:click="window.open(log.url)">重新下载</el-link>
                                    </div>
                                    <div v-else>
                                        <div class="mt-2" v-if="log.isGift || log.isPlan || log.isCourse || log.isFile || log.isAdmin || log.isUser || log.isTm || log.isDeleteTm || log.isExam || log.isExamQ || log.isExamAss || log.isExamPk || log.isExamCer || log.isKnowledge || log.isTmCorrection">
                                            <el-link class="fs-6" icon="el-icon-view" size="mini" v-on:click="btnViewClick(log)" v-if="log.isView">预览</el-link>
                                            <el-link class="fs-6" icon="el-icon-edit" size="mini" v-on:click="btnEditClick(log)" v-if="log.isEdit">编辑</el-link>
                                        </div>
                                    </div>
                                </div>
                            </el-timeline-item> 
                        </el-timeline>
                        <div class="py-5 text-center">
                            <el-link :size="euiSize" type="primary" icon="el-icon-refresh-right" v-if="list.length>0 && list.length<total" v-on:click="btnLoadMoreClick" :loading="loadMoreLoading">加载更多</el-link>
                            <small v-else>没有更多了</small>
                        </div>
                    </div>
                    <div v-else>
                        <el-timeline>
                            <el-timeline-item timestamp="暂无动态" placement="bottom">
                            </el-timeline-item>
                        </el-timeline>
                    </div>
                </el-scrollbar>
            </div>
        </el-col>
        <el-col :span="16">
            <div>
                <el-row :gutter="16">
                    <template v-if="systemCode==='Exam'">
                        <el-col :span="9">
                            <el-button :disabled="examTotalToday===0" type="success" plain class="w-100 card-lift rounded-pill px-5 border-0" v-on:click="btnTodayExam('today')">
                                <div class="d-flex justify-content-between align-items-center">
                                    <span><i class="el-icon-date me-2"></i>今日考试安排</span>
                                    <span class="fw-bold fs-2">{{ examTotalToday }}</span>
                                </div>
                            </el-button>
                        </el-col>
                        <el-col :span="9">
                            <el-button :disabled="examTotalWeek===0" type="primary" plain class="w-100 card-lift rounded-pill px-5 border-0" v-on:click="btnTodayExam('week')">
                                <div class="d-flex justify-content-between align-items-center">
                                    <span><i class="el-icon-date me-2"></i>本周考试安排</span>
                                    <span class="fw-bold fs-2">{{ examTotalWeek }}</span>
                                </div>
                            </el-button>
                        </el-col>
                        <el-col :span="6">
                            <el-button plain type="warning" class="w-100 card-lift rounded-pill border-0" v-on:click="btnDoc">
                                <div class="d-flex justify-content-between align-items-center">
                                    <span>考试档案</span>
                                    <i class="bi bi-person-lines-fill ms-2 fs-2 fw-bolder"></i>
                                </div>
                            </el-button>
                        </el-col>
                    </template>
                    <template v-else>
                        <el-col :span="9">
                            <el-dropdown :show-timeout="0" placement="bottom" class="w-100">
                                <el-button type="primary" plain class="w-100 card-lift rounded-pill px-5 border-0" v-on:click="btnTaskStudy" :disabled="taskStudyTotal===0">
                                    <div class="d-flex justify-content-between align-items-center">
                                        <span><i class="el-icon-date me-2"></i>近期培训</span>
                                        <span class="fw-bold fs-2">{{ taskStudyTotal }}</span>
                                    </div>
                                </el-button>
                                <el-dropdown-menu slot="dropdown">
                                    <div class="d-flex justify-content-between align-items-center px-3">
                                        <el-button class="btn btn-outline-primary border-0" v-on:click="btnCreatePlan" :disabled="planCreateTotal===0">
                                            <span>本月发布计划</span>
                                            <span class="ms-3 fw-bold">{{ planCreateTotal }}</span>
                                        </el-button>
                                        <el-divider direction="vertical"></el-divider>
                                        <el-button class="btn btn-outline-primary border-0" v-on:click="btnOverPlan" :disabled="planOverTotal===0">
                                            <span>本月将完成计划</span>
                                            <span class="ms-3 fw-bold">{{ planOverTotal }}</span>
                                        </el-button>
                                        <el-divider direction="vertical"></el-divider>
                                        <el-button class="btn btn-outline-primary border-0" v-on:click="btnWeekOfftrain" :disabled="offTrainTotal===0">
                                            <span>本周面授课</span>
                                            <span class="ms-3 fw-bold">{{ offTrainTotal }}</span>
                                        </el-button>
                                    </div>
                                </el-dropdown-menu>
                            </el-dropdown>

                        </el-col>
                        <el-col :span="9">
                            <el-dropdown :show-timeout="0" placement="bottom" class="w-100">
                                <el-button type="success" plain class="w-100 card-lift rounded-pill px-5 border-0" v-on:click="btnTaskExam" :disabled="taskExamTotal===0">
                                    <div class="d-flex justify-content-between align-items-center">
                                        <span><i class="el-icon-date me-2"></i>近期考试安排</span>
                                        <span class="fw-bold fs-2">{{ taskExamTotal }}</span>
                                    </div>
                                </el-button>
                                <el-dropdown-menu slot="dropdown">
                                    <div class="d-flex justify-content-between align-items-center px-3">
                                        <el-button class="btn btn-outline-success border-0" v-on:click="btnTodayExam('today')" :disabled="examTotalToday===0">
                                            <span>今日考试安排</span>
                                            <span class="ms-3 fw-bold">{{ examTotalToday }}</span>
                                        </el-button>
                                        <el-divider direction="vertical"></el-divider>
                                        <el-button class="btn btn-outline-success border-0" v-on:click="btnTodayExam('week')" :disabled="examTotalWeek===0">
                                            <span>本周考试安排</span>
                                            <span class="ms-3 fw-bold">{{ examTotalWeek }}</span>
                                        </el-button>
                                    </div>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </el-col>
                        <el-col :span="6">
                            <el-button plain type="warning" class="w-100 card-lift rounded-pill border-0" v-on:click="btnDoc">
                                <div class="d-flex justify-content-between align-items-center">
                                    <span>学习档案</span>
                                    <i class="bi bi-person-lines-fill ms-2 fs-2 fw-bolder"></i>
                                </div>
                            </el-button>
                        </el-col>
                  </template>
                </el-row>
            </div>
            <el-card class="rounded-5 mt-3 pe-5">
                <div class="row">
                    <div class="col-1 ps-3 pt-1">
                        <h4><i class="el-icon-s-data"></i><br />数<br />据<br />简<br />报</h4>
                    </div>
                    <div class="col-11 p-0">
                        <el-card class="mb-3 rounded-5 border-0" shadow="hover">
                            <div class="d-flex align-items-center justify-content-between">
                                <el-divider direction="vertical"></el-divider>
                                <div>组织：{{ totalCompany }}</div>
                                <el-divider direction="vertical"></el-divider>
                                <div>管理员：{{ totalAdmin }}</div>
                                <el-divider direction="vertical"></el-divider>
                                <div>用户：{{ totalUser }}</div>
                                <el-divider direction="vertical"></el-divider>
                                <div>题目：{{ totalTm }}</div>
                                <el-divider direction="vertical"></el-divider>
                                <div>课件：{{ totalFile }}</div>
                                <el-divider direction="vertical"></el-divider>
                            </div>
                        </el-card>
                        <apexchart type="bar" :options="chartOptions" :series="series" :height="($(window).height()-280)"></apexchart>
                    </div>
                </div>
            </el-card>
        </el-col>
    </el-row>
</el-card>

@section Scripts{
    <script src="/sitefiles/assets/lib/apexcharts/apexcharts.js" type="text/javascript"></script>
    <script src="/sitefiles/assets/lib/apexcharts/vue-apexcharts.js" type="text/javascript"></script>
    <script src="/sitefiles/assets/js/admin/dashboardAdmin.js" type="text/javascript"></script>
}